<template>
  <view class="fixed w-100 h134 bottom44 px-5 left0">
    <view
      class="w-100 h134 px-2 bg-theme f-c-c circle200"
      :class="['home', 'my'].includes(index) ? '' : 'show0'"
    >
      <view
        class="w-20"
        v-for="item in list"
        :key="item.icon"
        @click="set_url(item.icon)"
      >
        <view class="fs-n-c" v-if="item.icon == index">
          <image
            class="w48 h48 bg-foot w70 h70 p-11 rounded-circle"
            :src="item.icon_url"
          ></image>
        </view>
        <view class="fs-n-c" v-else>
          <image class="w38 h38" :src="item.icon_cur"></image>
          <view class="w-100 t-b font22 f-c-c h30">{{ item.title }}</view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import { mapState, mapActions } from "vuex";
export default {
  props: {
    index: {},
  },
  computed: {
    ...mapState("user", ["isLogin"]),
  },
  data() {
    return {
      toUrl: "",
      list: [
        {
          title: "首页",
          icon: "home",
          icon_url: "../static/footer/icon_1.png",
          icon_cur: "../static/footer/icon_cur_1.png",
        },
        {
          title: "购票",
          icon: "ticket",
          icon_url: "../static/footer/icon_2.png",
          icon_cur: "../static/footer/icon_cur_2.png",
        },
        {
          title: "成长",
          icon: "map",
          icon_url: "../static/footer/icon_3.png",
          icon_cur: "../static/footer/icon_cur_3.png",
        },
        // {
        //   title: "百货",
        //   icon: "shop",
        //   icon_url: "../static/footer/icon_4.png",
        //   icon_cur: "../static/footer/icon_cur_4.png",
        // },
        {
          title: "我的",
          icon: "my",
          icon_url: "../static/footer/icon_5.png",
          icon_cur: "../static/footer/icon_cur_5.png",
        },
      ],
    };
  },
  methods: {
    set_url(val) {
      if (this.index === val) return;
      // if(!this.isLogin){
      // 	return uni.showToast({
      // 		title:'请注册会员',
      // 		icon:'none'
      // 	})
      // }
      uni.redirectTo({
        url: `/pages/${val}/index`,
      });
      uni.setStorageSync("nav_code", "");
    },
  },
};
</script>

<style scoped>
.fixed {
  z-index: 99;
}
.p-11 {
  padding: 11rpx;
}
</style>
